<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Ta交易数据</title>

    <!--layui的CSS样式-->
    <link type="text/css" rel="stylesheet" href="../lib/layuimini/lib/layui-v2.5.5/css/layui.css"/>
    <!--layui的js-->
    <script src="../lib/layuimini/lib/layui-v2.5.5/layui.js"></script>
    <!--第三方下拉表格js-->
    <script src="../lib/layuimini/js/lay-config.js"></script>
    <!--自己js的路径-->
    <script type="text/javascript" src="./js/taManagement.js"></script>
    <script type="text/javascript">
        function addsum(a){
            var quantity= document.getElementById("quantity").value
            var cost= document.getElementById("cost").value
            var unitPrice= document.getElementById("unitPrice").value
            var sum=quantity*unitPrice+cost
            var money= document.getElementById("money").value=sum
            var practicalMoney= document.getElementById("practicalMoney").value=sum
        }
        function addsum1(a){
            var quantity1= document.getElementById("quantity1").value
            var cost1= document.getElementById("cost1").value
            var unitPrice1= document.getElementById("unitPrice1").value
            var sum1=quantity1*unitPrice1+cost1
            var money1= document.getElementById("money1").value=sum1
            var practicalMoney1= document.getElementById("practicalMoney1").value=sum1
        }
    </script>
</head>

<script type="text/html" id="toolEventDemo">
    <a class="layui-btn layui-btn-xs" style="background-color: #1E9FFF" lay-event="edit"><i
            class="layui-icon">&#xe642;</i>编辑</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i
            class="layui-icon">&#xe640;</i>删除</a>
</script>



<body>


<!--表格元素 lay-filter 通过这个属性来筛选绑定的表格-->
<table id="mytable" lay-filter="mytable"></table>

<!--上方工具条-->
<!--lay-event 是跟js的Switch case 后的名字一样的-->
<script type="text/html" id="TaToolBar">
    <div style="float:right">
        <button class="layui-btn layui-btn-sm layui-btn"
                lay-event="TaShengou" id="TaShengou">
            <i class="layui-icon">&#xe67c;</i>申购数据导入
        </button>
        <button class="layui-btn layui-btn-sm layui-btn"
                lay-event="TaShuhui" id="TaShuhui">
            <i class="layui-icon">&#xe67c;</i>赎回数据导入
        </button>
        <button class="layui-btn layui-btn-normal layui-btn layui-btn-sm" lay-event="add">
            <i class="layui-icon">&#xe654;</i>添加数据
        </button>
        <button class="layui-btn layui-btn-primary layui-btn layui-btn-sm" lay-event="deleteAll" style="color: #FF0000">
            <i class="layui-icon">&#xe640;</i>批量删除
        </button>
    </div>


    <!--  form表单  -->
    <!--   采用用户的名字来进行模糊查询-->
    <form class="layui-form layui-col-space5">
        <!--        选择日期，没有写底层，只是写了日期框的组件-->
        <div class="layui-inline layui-show-xs-block">
            <label class="layui-form-label" style="width: 90px;text-align: center">交易日期</label>

            <div class="layui-inline layui-show-xs-block" style="width: 130px">
                <input class="layui-input dateStr" autocomplete="off" placeholder="交易日期" name="dealTime" id="dealTime">
            </div>
        </div>

        <div class="layui-inline layui-show-xs-block">
            <label class="layui-form-label layui-bg-gray" style="width: 90px;text-align: center">交易状态</label>
        </div>
        <div class="layui-inline layui-show-xs-block" style="width: 130px">
            <select name="dealState" id="dealState">
                <option placeholder="请选择"></option>
                <option value="2">未结算</option>
                <option value="1">已结算</option>
            </select>
        </div>

        <div class="layui-inline layui-show-xs-block">
            <label class="layui-form-label layui-bg-gray" style="width: 90px;text-align: center">交易类型</label>
        </div>
        <div class="layui-inline layui-show-xs-block" style="width: 130px">
            <select name="dealType" id="dealType">
                <option placeholder="请选择"></option>
                <option value="3">认购</option>
                <option value="2">赎回</option>
                <option value="1">申购</option>
            </select>
        </div>
        <!-- 模糊查询的按钮  -->
        <!-- type="button 这个是为了不让layui提交两次-->
        <div class="layui-inline layui-show-xs-block">
            <button class="layui-btn layui-btn-normal" lay-submit="" lay-event="search"
                    lay-filter="sreach" type="button"><i class="layui-icon">&#xe615;</i>搜索
            </button>
        </div>
    </form>
</script>

<!--新增用户的窗口网页，删除，修改，一个模块就一个新的窗口网页好些，不需要通用-->
<div id="addta" style="width:100%;display: none;text-align: center;">
    <form id="addForm" class="layui-form layui-form-pane" style="display: inline-block" action=""><br>

        <div class="layui-form-item" style="text-align: center;display: none">
            <label class="layui-form-label layui-bg-gray" style="width: 120px">现金账户Id</label>
            <div class="layui-input-inline">
                <input type="text" name="cashId" id="cashId1" lay-verify="required|cashId"
                       placeholder="现金账户Id" autocomplete="off" class="layui-input" >
            </div>
            <label class="layui-form-label layui-bg-gray" style="width: 120px">基金Id</label>
            <div class="layui-input-inline">
                <input type="text" name="fundId" id="fundId1" lay-verify="required|fundId"
                       placeholder="基金Id" autocomplete="off" class="layui-input" >
            </div>
        </div>

        <div class="layui-form-item" style="text-align: center;">
            <label class="layui-form-label layui-bg-gray" style="width: 120px">现金账户名称</label>
            <div class="layui-input-inline">
                <input type="text" name="accountName" id="accountName1" lay-verify="required|accountName"
                       placeholder="现金账户名称" autocomplete="off" class="layui-input" >
            </div>
            <label class="layui-form-label layui-bg-gray" style="width: 120px">基金名称</label>
            <div class="layui-input-inline">
                <input type="text" name="fundName" id="fundName1" lay-verify="required|accountName"
                       placeholder="基金名称" autocomplete="off" class="layui-input" >
            </div>
        </div>

        <div class="layui-form-item" style="text-align: center;">
            <label class="layui-form-label layui-bg-gray" style="width: 120px">数量</label>
            <div class="layui-input-inline">
                <!-- lay-verify  表单验证 required 必填-->
                <input id="quantity" type="text" name="quantity" lay-verify="required|quantity"
                       placeholder="数量" autocomplete="off" class="layui-input" onkeyup="addsum(this)">
            </div>
            <label class="layui-form-label layui-bg-gray" style="width: 120px">费用</label>
            <div class="layui-input-inline">
                <!-- lay-verify  表单验证 required 必填-->
                <input id="cost" type="text" name="cost" lay-verify="required|cost"
                       placeholder="费用" autocomplete="off" class="layui-input" onkeyup="addsum(this)">
            </div>
        </div>

        <div class="layui-form-item" style="text-align: center;">
            <label class="layui-form-label layui-bg-gray" style="width: 120px">单价</label>
            <div class="layui-input-inline">
                <!-- lay-verify  表单验证 required 必填-->
                <input id="unitPrice" type="text" name="unitPrice" lay-verify="required|unitPrice"
                       placeholder="单价" autocomplete="off" class="layui-input" onkeyup="addsum(this)">
            </div>
            <label class="layui-form-label layui-bg-gray" style="width: 120px">总金额</label>
            <div class="layui-input-inline">
                <!-- lay-verify  表单验证 required 必填-->
                <input id="money" type="text" name="money" lay-verify="required|money"
                       placeholder="总金额" autocomplete="off" class="layui-input" readonly="readonly">
            </div>
        </div>

        <div class="layui-form-item" style="text-align: center;">
            <label class="layui-form-label  layui-bg-gray" style="width: 120px">实际金额</label>
            <div class="layui-input-inline">
                <!-- lay-verify  表单验证 required 必填-->
                <input id="practicalMoney" type="text" name="practicalMoney" lay-verify="required|practicalMoney"
                       placeholder="实际金额" autocomplete="off" class="layui-input" readonly="readonly">
            </div>
            <label class="layui-form-label layui-bg-gray" style="width: 120px">交易日期</label>
            <div class="layui-input-inline">
                <input autocomplete="off" class="layui-input dateStr2" lay-verify="dealTime" name="dealTime"
                       placeholder="交易日期" type="text">
            </div>
        </div>
        <div class="layui-form-item" style="text-align: center;">
            <label class="layui-form-label layui-bg-gray" style="width: 120px">结算日期</label>
            <div class="layui-input-inline">
                <input autocomplete="off" class="layui-input dateStr3" lay-verify="endTime" name="endTime"
                       placeholder="结算日期" type="text">
            </div>
            <label class="layui-form-label  layui-bg-gray" style="width: 120px">代销机构</label>
            <div class="layui-input-inline">
                <select xm-select-radio=""
                        xm-select-search="" lay-verify="required"
                        xm-select-direction="down" xm-select-search-type="dl" name="commissionAgents"/>
                <option selected="selected" value="1">农业银行</option>
                <option value="2">工商银行</option>
                <option value="3">建设银行</option>
                </select>
            </div>
        </div>

        <div class="layui-form-item" style="text-align: center;">
            <label class="layui-form-label  layui-bg-gray" style="width: 120px">交易类型</label>
            <div class="layui-input-inline">
                <select xm-select-radio=""
                        xm-select-search="" lay-verify="required"
                        xm-select-direction="down" xm-select-search-type="dl" name="dealType"/>
                <option selected="selected" value="1">申购</option>
                <option value="2">赎回</option>
                <option value="3">认购</option>
                </select>
            </div>
            <label class="layui-form-label  layui-bg-gray" style="width: 120px">基金类型</label>
            <div class="layui-input-inline">
                <select xm-select-radio=""
                        xm-select-search="" lay-verify="required"
                        xm-select-direction="down" xm-select-search-type="dl" name="dealState">
                <option value="1">已结算</option>
                <option selected="selected" value="2">未结算</option>
                </select>
            </div>
        </div>

        <div class="layui-form-item" style="width:80%;margin-left: 10%;text-align: center;position: relative;bottom: -20px">
            <button class="layui-btn"  style="background-color: #1E9FFF" lay-submit="" lay-filter="addta" >
                <i class="layui-icon">&#x1005;</i>添加
            </button>
            <button class="layui-btn layui-btn-primary" type="button" style="color: #FF0000" onclick="quxiao()">
                <i class="layui-icon">&#x1006;</i>取消
            </button>
        </div>
    </form>
</div>

<!--修改用户的窗口网页，删除，修改，一个模块就一个新的窗口网页好些，不需要通用-->
<div id="updateTa" style="width:100%;display: none;text-align: center;">
    <form id="UpdateForm" class="layui-form layui-form-pane" lay-filter="myFrom" style="display: inline-block" action=""><br>

        <div class="layui-form-item" style="text-align: center;display: none">
            <label class="layui-form-label layui-bg-gray" style="width: 120px">交易数据Id</label>
            <div class="layui-input-inline">
                <!-- lay-verify  表单验证 required 必填-->
                <input type="text" name="taId" lay-verify="required|taId"
                       placeholder="交易数据Id" readonly="true" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item" style="text-align: center;display: none">
            <label class="layui-form-label layui-bg-gray" style="width: 120px">现金账户Id</label>
            <div class="layui-input-inline">
                <input type="text" name="cashId" id="cashId2" lay-verify="required|cashId"
                       placeholder="现金账户Id" autocomplete="off" class="layui-input" >
            </div>
            <label class="layui-form-label layui-bg-gray" style="width: 120px">基金Id</label>
            <div class="layui-input-inline">
                <input type="text" name="fundId" id="fundId2" lay-verify="required|fundId"
                       placeholder="基金Id" autocomplete="off" class="layui-input" >
            </div>
        </div>

        <div class="layui-form-item" style="text-align: center;">
            <label class="layui-form-label layui-bg-gray" style="width: 120px">现金账户名称</label>
            <div class="layui-input-inline">
                <input type="text" name="accountName" id="accountName2" lay-verify="required|accountName"
                       placeholder="现金账户id" autocomplete="off" class="layui-input" >
            </div>
            <label class="layui-form-label layui-bg-gray" style="width: 120px">基金名称</label>
            <div class="layui-input-inline">
                <input type="text" name="fundName" id="fundName2" lay-verify="required|fundName"
                       placeholder="基金id" autocomplete="off" class="layui-input" >
            </div>
        </div>

        <div class="layui-form-item" style="text-align: center;">
            <label class="layui-form-label layui-bg-gray" style="width: 120px">数量</label>
            <div class="layui-input-inline">
                <!-- lay-verify  表单验证 required 必填-->
                <input id="quantity1" type="text" name="quantity" lay-verify="required|quantity"
                       placeholder="数量" autocomplete="off" class="layui-input" onkeyup="addsum1(this)">
            </div>
            <label class="layui-form-label layui-bg-gray" style="width: 120px">费用</label>
            <div class="layui-input-inline">
                <!-- lay-verify  表单验证 required 必填-->
                <input id="cost1" type="text" name="cost" lay-verify="required|cost"
                       placeholder="费用" autocomplete="off" class="layui-input" onkeyup="addsum1(this)">
            </div>
        </div>

        <div class="layui-form-item" style="text-align: center;">
            <label class="layui-form-label layui-bg-gray" style="width: 120px">单价</label>
            <div class="layui-input-inline">
                <!-- lay-verify  表单验证 required 必填-->
                <input id="unitPrice1" type="text" name="unitPrice" lay-verify="required|unitPrice"
                       placeholder="单价" autocomplete="off" class="layui-input" onkeyup="addsum1(this)">
            </div>
            <label class="layui-form-label layui-bg-gray" style="width: 120px">总金额</label>
            <div class="layui-input-inline">
                <!-- lay-verify  表单验证 required 必填-->
                <input id="money1" type="text" name="money" lay-verify="required|money"
                       placeholder="总金额" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item" style="text-align: center;">
            <label class="layui-form-label  layui-bg-gray" style="width: 120px">实际金额</label>
            <div class="layui-input-inline">
                <!-- lay-verify  表单验证 required 必填-->
                <input id="practicalMoney1" type="text" name="practicalMoney" lay-verify="required|practicalMoney"
                       placeholder="实际金额" autocomplete="off" class="layui-input" >
            </div>
            <label class="layui-form-label layui-bg-gray" style="width: 120px">交易日期</label>
            <div class="layui-input-inline">
                <input autocomplete="off" class="layui-input dateStr4" lay-verify="dealTime" name="dealTime"
                       placeholder="交易日期" type="text">
            </div>
        </div>
        <div class="layui-form-item" style="text-align: center;">
            <label class="layui-form-label layui-bg-gray" style="width: 120px">结算日期</label>
            <div class="layui-input-inline">
                <input autocomplete="off" class="layui-input dateStr5" lay-verify="endTime" name="endTime"
                       placeholder="结算日期" type="text">
            </div>
            <label class="layui-form-label  layui-bg-gray" style="width: 120px">代销机构</label>
            <div class="layui-input-inline">
                <select xm-select-radio=""
                        xm-select-search="" lay-verify="required"
                        xm-select-direction="down" xm-select-search-type="dl" name="commissionAgents"/>
                <option>请选择</option>
                <option value="1">农业银行</option>
                <option value="2">工商银行</option>
                <option value="3">建设银行</option>
                </select>
            </div>
        </div>

        <div class="layui-form-item" style="text-align: center;">
            <label class="layui-form-label  layui-bg-gray" style="width: 120px">交易类型</label>
            <div class="layui-input-inline">
                <select xm-select-radio=""
                        xm-select-search="" lay-verify="required"
                        xm-select-direction="down" xm-select-search-type="dl" name="dealType"/>
                <option>请选择</option>
                <option value="1">申购</option>
                <option value="2">赎回</option>
                <option value="3">认购</option>
                </select>
            </div>
            <label class="layui-form-label  layui-bg-gray" style="width: 120px">基金类型</label>
            <div class="layui-input-inline">
                <select xm-select-radio=""
                        xm-select-search="" lay-verify="required"
                        xm-select-direction="down" xm-select-search-type="dl" name="dealState"/>
                <option>请选择</option>
                <option value="1">已结算</option>
                <option value="2">未结算</option>
                </select>
            </div>
        </div>

        <div class="layui-form-item" style="width:80%;margin-left: 10%;text-align: center;position: relative;bottom: -20px">
            <button class="layui-btn"  style="background-color: #1E9FFF" lay-submit="" lay-filter="updateTa" >
                <i class="layui-icon">&#x1005;</i>修改
            </button>
            <button class="layui-btn layui-btn-primary" type="button" style="color: #FF0000" onclick="quxiao()">
                <i class="layui-icon">&#x1006;</i>取消
            </button>
        </div>
    </form>
</div>

</body>
</html>